<!--
  @author heguanghua
  @since 2020/05/31 12:26
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss"/>
<body>

<div class="layui-fluid"
     th:with="hasDetail=${#authPermit.checkPermit('/dept/detail.action')},
     hasDpermitOrganizeList=${#authPermit.checkPermit('/dept/dpermit/organize/tree.action')},
     hasDpermitOrganizeList2=${#authPermit.checkPermit('/dept/dpermit/organize/list.action')},
     hasDpermitDeptList=${#authPermit.checkPermit('/dept/dpermit/dept/tree.action')},
     hasDpermitAreaList=${#authPermit.checkPermit('/dept/dpermit/area/tree.action')},
     hasDpermitChannelList=${#authPermit.checkPermit('/dept/dpermit/channel/tree.action')},
     hasDpermitCubeList=${#authPermit.checkPermit('/dept/dpermit/cube/tree.action')},
     hasDpermitMeasureList=${#authPermit.checkPermit('/dept/dpermit/measure/tree.action')},
     hasDpermitAdd=${#authPermit.checkPermit('/dept/dpermit/modify/channel/add.action') && isAssignAdmin},
     hasDpermitDelete=${#authPermit.checkPermit('/dept/dpermit/modify/channel/delete.action') && isAssignAdmin}">

    <blockquote class="layui-crumb">
        <a lay-href="/organize/tree.action" lay-text="组织架构">组织架构管理</a>&nbsp;&nbsp;>&nbsp;
        <a th:lay-href="|${SYS_MCC}/organize/detail.action?orgId=${organize.orgId}|" th:lay-text="组织信息" th:text="${organize.orgName}">组织信息</a>&nbsp;&nbsp;>
        <a th:lay-href="|${SYS_MCC}/dept/tree.action?orgId=${obj.orgId}|" lay-text="部门管理">部门管理</a>&nbsp;&nbsp;>&nbsp;
        <a th:lay-href="|${SYS_MCC}/dept/detail.action?deptId=${obj.deptId}|" th:lay-text="部门信息" th:text="${obj.deptName}">部门信息</a>&nbsp;&nbsp;>
        合作数据权限
    </blockquote>

    <div class="layui-card">

        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title">
                <li th:if="${hasDpermitOrganizeList}"><a th:lay-href="|${SYS_MCC}/dept/dpermit/organize/tree.action?deptId=${obj.deptId}|" lay-text="组织权限">组织权限</a></li>
                <li th:if="${hasDpermitDeptList}"><a th:lay-href="|${SYS_MCC}/dept/dpermit/dept/tree.action?deptId=${obj.deptId}|" lay-text="部门权限">部门权限</a></li>
                <li th:if="${hasDpermitAreaList}"><a th:lay-href="|${SYS_MCC}/dept/dpermit/area/tree.action?deptId=${obj.deptId}|" lay-text="区域权限">区域权限</a></li>
                <li class="layui-this" th:if="${hasDpermitChannelList}"><a th:lay-href="|${SYS_MCC}/dept/dpermit/channel/tree.action?deptId=${obj.deptId}|" lay-text="合作权限">合作权限</a></li>
                <li th:if="${hasDpermitCubeList}"><a th:lay-href="|${SYS_MCC}/dept/dpermit/cube/tree.action?deptId=${obj.deptId}|" lay-text="大数据报表权限">大数据报表权限</a></li>
                <li th:if="${hasDpermitMeasureList}"><a th:lay-href="|${SYS_MCC}/dept/dpermit/measure/tree.action?deptId=${obj.deptId}|" lay-text="大数据指标权限">大数据指标权限</a></li>
            </ul>
        </div>

        <form method="POST" class="layui-form" action="/dept/dpermit/channel/list.action">
            <div th:replace="dept/dpermit/channel/_query::query"></div>
        </form>

        <div class="layui-card-body zmn-card-body layui-table-multi">

            <div th:replace="dept/dpermit/channel/_table::table"></div>

            <script type="text/html" id="zmn-table-tool">
                <div class="layui-btn-container">
                    <div class="layui-btn-group">
                        <button class="layui-btn layui-btn-sm" lay-event="cancel" th:if="${hasDpermitDelete}">取消选中合作的授权</button>
                    </div>
                    <div class="layui-btn-group">
                        <button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="add" th:if="${hasDpermitAdd}">+新增授权</button>
                    </div>
                </div>
            </script>

        </div>

    </div>

</div>
</body>
</html>

<script type="text/javascript" th:inline="javascript">

    var json = {
        deptId: [[${vo.deptId}]],
        totalCount: [[${vo.totalCount}]],
        pageSize: [[${vo.pageSize}]],
        pageIndex: [[${vo.pageIndex}]]
    };

    layui.extend({
        dept_dpermit_channel_list: "dept/zmn.dept.dpermit.channel.list",
    }).use(['index', 'dept_dpermit_channel_list']);

</script>
